package com.sx.epidemic_system.service.impl;

import com.sx.epidemic_system.entity.Patient;
import com.sx.epidemic_system.mapper.NewAddMapper;
import com.sx.epidemic_system.mapper.PatientMapper;
import com.sx.epidemic_system.service.NewAddService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NewAddServiceImp implements NewAddService
{
    @Autowired
    private NewAddMapper newAddMapper;
    private Patient patient=new Patient();

    @Override
    public int getAllNewAdd() {
        patient.setPatientType("1");
        return newAddMapper.getNewAllAdd(patient);
    }

    @Override
    public int getAllNewAddProvince(String province) {
        patient.setPatientType("1");
        patient.setProvince(province);
        return newAddMapper.getNewAllAdd(patient);
    }

    @Override
    public int getContinentNewAdd() {
        patient.setPatientType("1");
        return newAddMapper.getContinentNewAdd(patient);
    }

    @Override
    public int getContinentNewAddProvince(String province) {
        patient.setPatientType("1");
        patient.setProvince(province);
        patient.setCountry("中国");
        return newAddMapper.getContinentNewAdd(patient);
    }

    @Override
    public int getOutSideNewAdd()
    {
        patient.setPatientType("1");
        return newAddMapper.getOutSideNewAdd(patient);
    }

    @Override
    public int getOutSideNewAddProvince(String province) {
        patient.setProvince(province);
        patient.setPatientType("1");
        return newAddMapper.getOutSideNewAdd(patient);
    }

    @Override
    public int getAsymptomatic() {
        patient.setPatientType("2");

        return newAddMapper.getNewAllAdd(patient);
    }

    @Override
    public int getAsymptomaticProvince(String province) {
        patient.setPatientType("2");
        patient.setProvince(province);
        return newAddMapper.getNewAllAdd(patient);
    }
}
